<?php
namespace app\common\model;
class UnionOrder extends Base
{
    protected function initialize()
    {
        parent::initialize();
    }

    /* 签名 */
    public static function _getSign($Obj,$key) {
        foreach ($Obj as $k => $v) {    
            if($v) {
                $Parameters[$k] = $v;
            }
        }
        //签名步骤一：按字典序排序参数
        ksort($Parameters);
        foreach ($Parameters as $k => $v) {
            $buff .= $k . $v ;
        }
        $String = $key.$buff.$key;
        $String = md5($String);
        $result_ = strtoupper($String);
        return $result_;
    }

    public static function getOrderStatusText ($status) {
        $arr = array(
            '-1' => '未知',
            '2' => '无效-拆单',
            '3' => '无效-取消',
            '4' => '无效-京东帮帮主订单',
            '5' => '无效-账号异常',
            '6' => '无效-赠品类目不返佣',
            '7' => '无效-校园订单',
            '8' => '无效-企业订单',
            '9' => '无效-团购订单',
            '10' => '无效-开增值税专用发票订单',
            '11' => '无效-乡村推广员下单',
            '12' => '无效-自己推广自己下单(废弃)',
            '13' => '无效-违规订单',
            '14' => '无效-来源与备案网址不符',
            '15' => '待付款',
            '16' => '已付款',
            '17' => '已完成',
            '18' => '已结算'
        );
        return $arr[$status];
    }

    public static function getOrderPddStatusText ($status) {
        $arr = array(
            '-1'=>'未支付',
            '0'=>'已支付',
            '1'=>'已成团',
            '2'=>'确认收货',
            '3'=>'审核成功',
            '4'=>'审核失败（不可提现）',
            '5'=>'已经结算',
            '8'=>'非多多进宝商品（无佣金订单）'
        );
        return $arr[$status];
    }
}